import "./style.scss"
import ImageWithError from '@page/common/comps/ImageWithError'
import Uts from "@module/Uts";


class ItemRight extends React.Component {

    isSuppSelf(suppId){
        const isSuppSelf=Uts.getCookie('suppId')==suppId;
        return isSuppSelf;
    }

    render() {
        const {photo, price, name,productId} = this.props.data;
        return (
            <div className="rj_supplier_right" onClick={() => {

                    window.open(`#/detail?productId=${productId}&suppId=${this.props.supplierId}`)
                }}>
                <div className="rj_top">
                    <div className="rj_top_img">
                        {/*<img src={photo}></img>*/}
                        <ImageWithError
                            src={photo}
                        />
                    </div>
                </div>
                <div className="rj_center">
                    {!global.hasLogin&&!this.isSuppSelf(this.props.supplierId)?  ( global.isSupp? '单位登录可见':'价格登录可见'):`￥${price}`}
                </div>
                <div className="rj_bottom zen_646464">
                    {name}
                </div>
            </div>
        );
    }
}

export default ItemRight;